<%--
  Created by IntelliJ IDEA.
  User: xiaoziyan
  Date: 2022/4/26
  Time: 17:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>数据可视化</title>

    <link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon">

    <!-- 1. 导入CSS的全局样式 -->
    <link href="${pageContext.request.contextPath}/css/bootstrap.css" rel="stylesheet">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <!-- 2. jQuery导入，建议使用1.9以上的版本 -->
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.js"></script>
    <!-- 3. 导入bootstrap的js文件 -->
    <script src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
    <script src="${pageContext.request.contextPath}/layui/layui.js" charset="utf-8"></script>
    <script src="./js/echarts.min.js" ></script>

</head>
<body>
<!-- 为 ECharts 准备一个定义了宽高的 DOM -->
<h1>数据可视化</h1>


<div id="main" style="width: 100%;height:500px;"></div>


<script type="text/javascript">

    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option;

    option = {

        xAxis: {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
            type: 'value',
            max:10,
            minInterval: 0
        },
        series: [
            {
                data: [1, 2, 1, 0, 3, 1, 1],
                type: 'line',
                smooth: true,
                label: {
                    show: true,
                    position: 'top',
                    textStyle: {
                        fontSize: 20
                    }
                }
            }
        ]
    };

    option && myChart.setOption(option);
</script>
</body>


</html>

